package com.CodeIdeTest;

import com.api.POJO.LiveStreaming.LiveStreamingReturnMsg;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.reactive.function.client.WebClient;
import reactor.core.Disposable;
import reactor.core.publisher.Mono;

import java.util.Objects;

/**
 * @Description :
 * @Author :
 * @Date : 2021/12/17
 */
@SpringBootTest(classes = CodeIdeTestApplication.class)
public class CodeIdeTestApplication {

    @Test
    public void webClientTest(){
        RestTemplate restTemplate = new RestTemplate();
        ResponseEntity<LiveStreamingReturnMsg> forEntity = restTemplate.getForEntity("http://192.168.120.101:30616/live/get/all", LiveStreamingReturnMsg.class);
        System.out.println(forEntity.getStatusCode()+ Objects.requireNonNull(forEntity.getHeaders().get("Content-Type")).get(0)+forEntity.getBody());
    }

}
